package com.mall.server.inerceptor;


import com.tanhua.model.domain.UmsAdmin;

//ThreadLocal
public class UmsAdminHolder {

    private static ThreadLocal<UmsAdmin> t1 = new ThreadLocal();


    public static void set(UmsAdmin user){
        t1.set(user);
    }

    public static UmsAdmin get(){
        return t1.get();
    }

    public static Long getId(){
        return t1.get().getId();
    }

    public static String getName(){
        return t1.get().getUsername();
    }


    //清空
    public static void remove(){
        t1.remove();
    }
}
